<template>
  <div class="title-layout" :title="title" :class="{ 'division': division }">
    <div class="flex-content">
      <span class="title">{{ title }}</span>
      <slot name="content" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title1: {
      type: String,
      default: ''
    },
    division: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    title() {
      const route = this.$route
      const { meta } = route
      return this.title1 || meta.title
    }
  }
}
</script>

<style scoped lang="scss">
.title-layout {
  height: 25px;
  font-size: 14px;
  .flex-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 25px;
    .title {
      font-weight: 500;
      width: 130px;
      height: 18px;
      overflow: hidden;
      &::before {
        content: '';
        border-left: 5px solid #1890ff;
        margin-right: 5px;
      }
    }
  }
}
.division{
  border-bottom: 1px solid #f0f0f0;
}
</style>
